Skip to content

Conversation

yyzdtccjdtc
Copy link

Optimization for eliminating redundant memory operations related to this issue.
#280

@yyzdtccjdtc
Copy link
Author

@BurntSushi Is there are any changes I need to make for this pull request?

Comment on lines +669 to +671
if input[nin] == b'\n'{
self.line += 1;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have benchmarks backing this up? I'm a little skeptical that the cost of looking up self.line in order to increment it by zero is higher than the cost of adding a branch in the code path, at least on most modern CPUs where branches do unpleasant things to instruction pipelining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants